<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
PearsonsCorrelation (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="PearsonsCorrelation (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/PearsonsCorrelation.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/SpearmansCorrelation.html" title="class in org.apache.commons.math3.stat.correlation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="PearsonsCorrelation.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.stat.correlation</FONT>
<BR>
Class PearsonsCorrelation</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.stat.correlation.PearsonsCorrelation</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>PearsonsCorrelation</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Computes Pearson's product-moment correlation coefficients for pairs of arrays
 or columns of a matrix.

 <p>The constructors that take <code>RealMatrix</code> or
 <code>double[][]</code> arguments generate correlation matrices.  The
 columns of the input matrices are assumed to represent variable values.
 Correlations are given by the formula</p>
 <code>cor(X, Y) = &Sigma;[(x<sub>i</sub> - E(X))(y<sub>i</sub> - E(Y))] / [(n - 1)s(X)s(Y)]</code>
 where <code>E(X)</code> is the mean of <code>X</code>, <code>E(Y)</code>
 is the mean of the <code>Y</code> values and s(X), s(Y) are standard deviations.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>2.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: PearsonsCorrelation.java 1416643 2012-12-03 19:37:14Z tn $</DD>
</DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#PearsonsCorrelation()">PearsonsCorrelation</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a PearsonsCorrelation instance without data</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#PearsonsCorrelation(org.apache.commons.math3.stat.correlation.Covariance)">PearsonsCorrelation</A></B>(<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation">Covariance</A>&nbsp;covariance)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a PearsonsCorrelation from a <A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation"><CODE>Covariance</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#PearsonsCorrelation(double[][])">PearsonsCorrelation</A></B>(double[][]&nbsp;data)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a PearsonsCorrelation from a rectangular array
 whose columns represent values of variables to be correlated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#PearsonsCorrelation(org.apache.commons.math3.linear.RealMatrix)">PearsonsCorrelation</A></B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;matrix)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a PearsonsCorrelation from a RealMatrix whose columns
 represent variables to be correlated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#PearsonsCorrelation(org.apache.commons.math3.linear.RealMatrix, int)">PearsonsCorrelation</A></B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;covarianceMatrix,
                    int&nbsp;numberOfObservations)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a PearsonsCorrelation from a covariance matrix.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#computeCorrelationMatrix(double[][])">computeCorrelationMatrix</A></B>(double[][]&nbsp;data)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the correlation matrix for the columns of the
 input rectangular array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#computeCorrelationMatrix(org.apache.commons.math3.linear.RealMatrix)">computeCorrelationMatrix</A></B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;matrix)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the correlation matrix for the columns of the
 input matrix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#correlation(double[], double[])">correlation</A></B>(double[]&nbsp;xArray,
            double[]&nbsp;yArray)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the Pearson's product-moment correlation coefficient between the two arrays.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#covarianceToCorrelation(org.apache.commons.math3.linear.RealMatrix)">covarianceToCorrelation</A></B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;covarianceMatrix)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Derives a correlation matrix from a covariance matrix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#getCorrelationMatrix()">getCorrelationMatrix</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the correlation matrix</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#getCorrelationPValues()">getCorrelationPValues</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a matrix of p-values associated with the (two-sided) null
 hypothesis that the corresponding correlation coefficient is zero.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html#getCorrelationStandardErrors()">getCorrelationStandardErrors</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a matrix of standard errors associated with the estimates
 in the correlation matrix.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="PearsonsCorrelation()"><!-- --></A><H3>
PearsonsCorrelation</H3>
<PRE>
public <B>PearsonsCorrelation</B>()</PRE>
<DL>
<DD>Create a PearsonsCorrelation instance without data
<P>
</DL>
<HR>

<A NAME="PearsonsCorrelation(double[][])"><!-- --></A><H3>
PearsonsCorrelation</H3>
<PRE>
public <B>PearsonsCorrelation</B>(double[][]&nbsp;data)</PRE>
<DL>
<DD>Create a PearsonsCorrelation from a rectangular array
 whose columns represent values of variables to be correlated.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - rectangular array with columns representing variables
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the input data array is not
 rectangular with at least two rows and two columns.</DL>
</DL>
<HR>

<A NAME="PearsonsCorrelation(org.apache.commons.math3.linear.RealMatrix)"><!-- --></A><H3>
PearsonsCorrelation</H3>
<PRE>
public <B>PearsonsCorrelation</B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;matrix)</PRE>
<DL>
<DD>Create a PearsonsCorrelation from a RealMatrix whose columns
 represent variables to be correlated.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>matrix</CODE> - matrix with columns representing variables to correlate</DL>
</DL>
<HR>

<A NAME="PearsonsCorrelation(org.apache.commons.math3.stat.correlation.Covariance)"><!-- --></A><H3>
PearsonsCorrelation</H3>
<PRE>
public <B>PearsonsCorrelation</B>(<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation">Covariance</A>&nbsp;covariance)</PRE>
<DL>
<DD>Create a PearsonsCorrelation from a <A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation"><CODE>Covariance</CODE></A>.  The correlation
 matrix is computed by scaling the Covariance's covariance matrix.
 The Covariance instance must have been created from a data matrix with
 columns representing variable values.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>covariance</CODE> - Covariance instance</DL>
</DL>
<HR>

<A NAME="PearsonsCorrelation(org.apache.commons.math3.linear.RealMatrix, int)"><!-- --></A><H3>
PearsonsCorrelation</H3>
<PRE>
public <B>PearsonsCorrelation</B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;covarianceMatrix,
                           int&nbsp;numberOfObservations)</PRE>
<DL>
<DD>Create a PearsonsCorrelation from a covariance matrix.  The correlation
 matrix is computed by scaling the covariance matrix.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>covarianceMatrix</CODE> - covariance matrix<DD><CODE>numberOfObservations</CODE> - the number of observations in the dataset used to compute
 the covariance matrix</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getCorrelationMatrix()"><!-- --></A><H3>
getCorrelationMatrix</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>getCorrelationMatrix</B>()</PRE>
<DL>
<DD>Returns the correlation matrix
<P>
<DD><DL>

<DT><B>Returns:</B><DD>correlation matrix</DL>
</DD>
</DL>
<HR>

<A NAME="getCorrelationStandardErrors()"><!-- --></A><H3>
getCorrelationStandardErrors</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>getCorrelationStandardErrors</B>()</PRE>
<DL>
<DD>Returns a matrix of standard errors associated with the estimates
 in the correlation matrix.<br/>
 <code>getCorrelationStandardErrors().getEntry(i,j)</code> is the standard
 error associated with <code>getCorrelationMatrix.getEntry(i,j)</code>
 <p>The formula used to compute the standard error is <br/>
 <code>SE<sub>r</sub> = ((1 - r<sup>2</sup>) / (n - 2))<sup>1/2</sup></code>
 where <code>r</code> is the estimated correlation coefficient and
 <code>n</code> is the number of observations in the source dataset.</p>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>matrix of correlation standard errors</DL>
</DD>
</DL>
<HR>

<A NAME="getCorrelationPValues()"><!-- --></A><H3>
getCorrelationPValues</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>getCorrelationPValues</B>()</PRE>
<DL>
<DD>Returns a matrix of p-values associated with the (two-sided) null
 hypothesis that the corresponding correlation coefficient is zero.
 <p><code>getCorrelationPValues().getEntry(i,j)</code> is the probability
 that a random variable distributed as <code>t<sub>n-2</sub></code> takes
 a value with absolute value greater than or equal to <br>
 <code>|r|((n - 2) / (1 - r<sup>2</sup>))<sup>1/2</sup></code></p>
 <p>The values in the matrix are sometimes referred to as the
 <i>significance</i> of the corresponding correlation coefficients.</p>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>matrix of p-values
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</A></CODE> - if an error occurs estimating probabilities</DL>
</DD>
</DL>
<HR>

<A NAME="computeCorrelationMatrix(org.apache.commons.math3.linear.RealMatrix)"><!-- --></A><H3>
computeCorrelationMatrix</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>computeCorrelationMatrix</B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;matrix)</PRE>
<DL>
<DD>Computes the correlation matrix for the columns of the
 input matrix.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>matrix</CODE> - matrix with columns representing variables to correlate
<DT><B>Returns:</B><DD>correlation matrix</DL>
</DD>
</DL>
<HR>

<A NAME="computeCorrelationMatrix(double[][])"><!-- --></A><H3>
computeCorrelationMatrix</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>computeCorrelationMatrix</B>(double[][]&nbsp;data)</PRE>
<DL>
<DD>Computes the correlation matrix for the columns of the
 input rectangular array.  The colums of the array represent values
 of variables to be correlated.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - matrix with columns representing variables to correlate
<DT><B>Returns:</B><DD>correlation matrix</DL>
</DD>
</DL>
<HR>

<A NAME="correlation(double[], double[])"><!-- --></A><H3>
correlation</H3>
<PRE>
public double <B>correlation</B>(double[]&nbsp;xArray,
                          double[]&nbsp;yArray)</PRE>
<DL>
<DD>Computes the Pearson's product-moment correlation coefficient between the two arrays.

 </p>Throws IllegalArgumentException if the arrays do not have the same length
 or their common length is less than 2</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xArray</CODE> - first data array<DD><CODE>yArray</CODE> - second data array
<DT><B>Returns:</B><DD>Returns Pearson's correlation coefficient for the two arrays
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if the arrays lengths do not match
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></CODE> - if there is insufficient data</DL>
</DD>
</DL>
<HR>

<A NAME="covarianceToCorrelation(org.apache.commons.math3.linear.RealMatrix)"><!-- --></A><H3>
covarianceToCorrelation</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A> <B>covarianceToCorrelation</B>(<A HREF="../../../../../../org/apache/commons/math3/linear/RealMatrix.html" title="interface in org.apache.commons.math3.linear">RealMatrix</A>&nbsp;covarianceMatrix)</PRE>
<DL>
<DD>Derives a correlation matrix from a covariance matrix.

 <p>Uses the formula <br/>
 <code>r(X,Y) = cov(X,Y)/s(X)s(Y)</code> where
 <code>r(&middot,&middot;)</code> is the correlation coefficient and
 <code>s(&middot;)</code> means standard deviation.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>covarianceMatrix</CODE> - the covariance matrix
<DT><B>Returns:</B><DD>correlation matrix</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/PearsonsCorrelation.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/Covariance.html" title="class in org.apache.commons.math3.stat.correlation"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/correlation/SpearmansCorrelation.html" title="class in org.apache.commons.math3.stat.correlation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/stat/correlation/PearsonsCorrelation.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="PearsonsCorrelation.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
